﻿{extend name="base" /}

{block name="css"}
  <link rel="stylesheet" href="__HCSS__/cart/cart.css">
{/block}

{block name="body"}


<div class="main-container container">
	<ul class="breadcrumb">
		<li><a href="{:url('home/index/index')}"><i class="fa fa-home"></i></a></li>
		<li><a href="#">下订单</a></li>
	</ul>

	<div class="row">
		<!-- cart-main-area start -->
		<div class="cart-main-area pt-0">
			<div class="container">
				<div class="row">
					<div class="col-md-12 col-sm-12 col-xs-12">
					{if condition="$Think.session.user_id"}
						<form method="post" id="orderForm" action="{:url('home/Order/orderProc')}">
							<!-- 收货地址输入 -->
							<div class="table-content">
								<table>
									<h3>
										收货人信息
										<a href="javascript:void(0);" class="add-btn" data-url="{:url('home/UserAddress/add')}" proc-url="{:url('home/UserAddress/addProc')}">[添加新地址]</a>
									</h3>

									<tbody>
									{volist name="addressInfo" id="v"}
										<tr>
											<td><input type="radio" name="address_id" {$v.is_default == 1 ? "checked = 'checked'" : ""} value="{$v.id}"></td>
											<td>收货人：{$v.consignee}</td>
											<td>地址：{$v.province} {$v.city} {$v.area} {$v.addr}</td>
											<td>电话：{$v.mobile}</td>
											<td>
												{if condition="$v.is_default"}
													默认地址&nbsp;&nbsp;
												{else /}
													<a href="javascript:;" class="set-default-btn"  data-id="{$v.id}" data-url="{:url('home/UserAddress/setDefalut')}">[设为默认]</a>&nbsp;&nbsp;
												{/if}
												<a href="javascript:;" class="edit-btn"  data-id="{$v.id}" data-url="{:url('home/UserAddress/edit')}" proc-url="{:url('home/UserAddress/editProc')}">[编辑]</a>&nbsp;&nbsp;
												<a href="javascript:;" class="delete-btn"  data-id="{$v.id}" data-url="{:url('home/UserAddress/delete')}">[删除]</a>
											</td>
										</tr>
									{/volist}
									</tbody>
								</table>
							</div>
							<!-- 商品信息 -->
							<div class="table-content table-responsive">
								<table>
									<h3>
										商品信息
									</h3>
									<thead>
										<tr>
											<th >Logo</th>
											<th >商品</th>
											<th >商品规格</th>
											<th >单价</th>
											<th >数量</th>
											<th >小计</th>
										</tr>
									</thead>
									<tbody>
									{volist name="buyThisInfo" id="v"}
										<tr goods-id="{$v.goods_id}" goods-spec-key="{$v.goods_spec_key}" update-url="{:url('home/Cart/updateData')}">
											<td class="product-thumbnail">
												<a href="#"><img src="{$v.goods_image|show_image="goods",###}" alt="" /></a>
											</td>
											<td class="product-name">
												<a href="">{$v.goods_name}</a>
											</td>
											<td class="product-spec">
												<a href="">{$v.spec_details|default="没有规格信息"}</a>
											</td>
											<td class="product-price">
												{$v.price}
											</td>
											<td class="product-quantity">
												{$v.quantity}
											</td>
											<td class="product-subtotal">
												{$v.subtotal}
											</td>
										</tr>
									{/volist}
									</tbody>
								</table>
							</div>
							<div class="row">
								<div class="col-md-12 col-sm-12 col-xs-12">
									<div >
										<h3>附加信息</h3>
										<div class="form-group">
											<label  class="col-sm-1 control-label"><h4>发票抬头</h4></label>
											<div class="col-sm-3">
												<input type="text" name="invoice_title" value="" class="form-control"  placeholder="请谨慎选择发票抬头，订单出库后不能修改">
											</div>

											<label  class="col-sm-1 control-label"><h4>买家留言</h4></label>
											<div class="col-sm-7">
												<input type="text" name="user_remark" value="" class="form-control"  placeholder="备注留言">
											</div>

										</div>

									</div>
								</div>
								<div class="col-md-9 col-sm-7 col-xs-12">
									<div class="coupon">
										<h3>优惠卷</h3>
										<input type="text" placeholder="优惠券每次只能使用一张" />
										<input type="submit" value="使用" />
									</div>
								</div>
								<div class="col-md-9 col-sm-7 col-xs-12">
									<div class="coupon">
										<h3>积分支付</h3>
										<input type="text" placeholder="你可用的积分为100" />
										<input type="submit" value="使用" />
									</div>
								</div>
								<div class="col-md-3 col-sm-5 col-xs-12">
									<div class="cart_totals">
										<table>
											<tbody>
												<tr class="order-total">
													<th>总价</th>
													<td>
														<strong><span id="total" class="amount">{$totalPrice}</span></strong>
													</td>
												</tr>
											</tbody>
										</table>
										<div class="wc-proceed-to-checkout">
											<a href="javascript:;" class="submit-btn" data-url="{:url('home/Order/orderProc')}" jump-url="{:url('home/order/optionPayment')}">提交订单</a>
										</div>
									</div>
								</div>
							</div>
						</form>	
						{else /}
							<div class="row">
								<div class="col-md-9 col-sm-7 col-xs-12">
									<div class="buttons-cart">
									<h3>亲，登陆后才可以结算哦~</h3>
										<a href="javascript:void(0);" class="login_return" login-url="{:url('home/Login/index')}" save-url="{:url('home/Login/saveAndLogin')}">登陆</a>
									</div>
								</div>
							</div>
						{/if}
					</div>
				</div>
			</div>
		</div>
		<!-- cart-main-area end -->	
		<div>&nbsp;</div>

	</div>
</div>
<!-- //Main Container -->



{/block}

{block name="script"}
	<script type="text/javascript" src="__HJS__/order/order.js"></script>
{/block}